import {defineConfig} from "vite"
import vue from "@vitejs/plugin-vue2"
import path from "path"

// https://vitejs.dev/config/
export default defineConfig((mode) => {
  return {
    plugins: [vue()],
    server: {
      port: 8082,
      host: "0.0.0.0",
      proxy: {
        "/proxy": {
           target: "http://127.0.0.1:8810",
         //  target:"https://lginfo.fjrcsz.com:8920/api/",

        // target: "https://lg.fjrcsz.com/api/", //生产
          // target: "http://dev.6bqb.cn:8810",
          changeOrigin: true,
          secure: false,
          rewrite: (path) => path.replace(/^\/proxy/, ""),
        },
      },
    },
    resolve: {
      alias: {
        "@": path.resolve(__dirname, "src"),
      },
    },
  }
})
